//
//  VoiddetailViewController.m
//  Hero
//
//  Created by lanou3g on 16/5/6.
//  Copyright © 2016年 刘永庆. All rights reserved.
//

#import "VoiddetailViewController.h"

@interface VoiddetailViewController ()<UIWebViewDelegate>

@end

@implementation VoiddetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"英雄时刻";
    UIWebView *webView = [[UIWebView alloc]initWithFrame:self.view.frame];
    NSURL *url = [NSURL URLWithString:@"http://lol.178.com/201503/219354233559.html"];
    webView.scalesPageToFit = YES;
    webView.delegate = self;
    NSURLRequest *reque = [NSURLRequest requestWithURL:url];
    [webView loadRequest:reque];
    [self.view addSubview:webView];
}
//-(void)webViewDidFinishLoad:(UIWebView*)webView{
//    CGFloat  webViewHeight=[webView.scrollView contentSize].height;
//    CGRect newFrame = webView.frame;
//    newFrame.size.height = webViewHeight;
//    webView.frame = newFrame;
//}
-(void)webViewDidFinishLoad:(UIWebView*)webView{
    CGSize actualSize = [webView sizeThatFits:CGSizeZero];
    CGRect newFrame = webView.frame;
  newFrame.size.height = actualSize.height;
webView.frame = newFrame;
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
